/** @file bt_func.h
  *
  * @brief This file contains function definition
  * of Bluetooth driver.
  * 
  * (c) Copyright 2003-2007, Marvell International Ltd.
  * All Rights Reserved
  */

#ifndef _BT_FUNC_H_
#define _BT_FUNC_H_

#include "If.h"
#include "bt_def.h"

#ifdef __cplusplus
extern "C" {
#endif //__cplusplus


MRVL_STATUS MrvBTDrvInit(DWORD dwContext);
MRVL_STATUS MrvBTDrvDeInit(DWORD dwContext);

MRVL_STATUS SendSinglePacket(PUCHAR buf,
                             ULONG bufLen);

MRVL_STATUS AllocateRxQ(PMRVDRV_ADAPTER Adapter);
MRVL_STATUS FreeRxQ(PMRVDRV_ADAPTER Adapter);
VOID HandleRxReadyEvent(PMRVDRV_ADAPTER Adapter);
BOOL HandleHCIReadPacket(PMRVDRV_ADAPTER Adapter,
                         PUCHAR pBuffer,
                         PUINT pPacketSize,
                         PUCHAR pType);
MRVL_STATUS HandleBTVendorPacket(PMRVDRV_ADAPTER Adapter,
                                 PUCHAR pBuffer);

VOID MrvIstThreadProc(PVOID pContext);
#ifdef INIT_THREAD
VOID MrvInitThreadProc(PVOID pContext);
#endif

IF_FW_STATUS sdio_FirmwareDownload(PMRVDRV_ADAPTER Adapter);
IF_FW_STATUS sdio_IsFirmwareLoaded(PMRVDRV_ADAPTER Adapter);

VOID SDSlotEventCallBack(SD_DEVICE_HANDLE    hDevice,
                         PVOID               pContext,
                         SD_SLOT_EVENT_TYPE  SlotEventType,
                         PVOID               pData,
                         DWORD               DataLength);

SD_API_STATUS SDIODownloadPkt(PMRVDRV_ADAPTER Adapter,
                              UCHAR Function,
                              PUCHAR pDownloadPkt,
                              ULONG DownloadLen);

SD_API_STATUS SDInterruptCallback(SD_DEVICE_HANDLE hDevice, 
                                  PVOID pContext);

MRVL_STATUS SendBTCommand(PMRVDRV_ADAPTER Adapter,
                          UCHAR option,
                          UCHAR cmd,
                          UCHAR subcmd0,
                          UCHAR subcmd1);

#ifdef DBG_MSG_TO_RETAILMSG 
void MrvRETAILMSG(const wchar_t *fmt, ...);   
#endif

#ifdef MRVL_PRINT_DBG_MSG
void MrvPrintFile(const unsigned short *fmt, ...);
#endif

BOOL AddKeyValues(LPWSTR KeyName, PREG_VALUE_DESCR Vals);

#ifdef __cplusplus
}
#endif //__cplusplus

#endif
